﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace cnFederal.Controls
{
    public partial class VideosCtrl : System.Web.UI.UserControl
    {
         List<Fvideo> _videoList;
        int _pager;
        #region init settings
        // player width
        private int _W = 250;

        // player height
        private int _H = 200;

        // autoplay disabled
        bool auto = false;
        #endregion
        public VideosCtrl()
        {
            Fvideos.Load(true);
            _videoList = Fvideos.GetTopVideos(5);
            _pager = 0;
        }

        public string GetYoutubeUrl(string youtubeCode)
        {
           return YouTubeScript.Get(youtubeCode, false,
            _W, _H, true, "maroon", "", 15);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ListViewVideoStrip.DataSource = _videoList;
            ListViewVideoStrip.DataBind();
        }
        protected void pagerStrip_click(object sender, EventArgs e)
        {

            int lastpage = this.DataPagerVideoStrip.StartRowIndex;

            DataPagerVideoStrip.SetPageProperties(lastpage, DataPagerVideoStrip.MaximumRows, false);
            ListViewVideoStrip.DataBind();
        }
    }
}